<?php

/**
 * application class
 * 
 * @author Alexey A. Frolov <frolov.alexey@gmail.com>
 */
class TPageService extends TModule
{
	protected $page;

	protected static $objSelf = null;
	
	protected function __construct()
	{
	}
	
	public static function getInstance($class = __CLASS__)
	{
		if (self::$objSelf)
			return self::$objSelf;
		else
		{
			self::$objSelf = new $class;
			return self::$objSelf; 
		}
	}
	
	/**
	 * register application
	 * 
	 * @access public
	 */
	public function register()
	{
		parent::register();
		$this->page = new TPage();
		$this->page->register();
		
		$this->page->onInit();
	}
	
	/**
	 * run application
	 * 
	 * @access public
	 */
	public function run()
	{
		$this->page->onLoad();

	}
	
	/**
	 * register application
	 * 
	 * @access public
	 */
	public function unregister()
	{
		parent::unregister();
	}
}
?>